<script type="text/javascript">
    $(document).ready(function() {
        //$('#').jqTransform({imgPath:'<?= site_url() ?>/assets/css/jqTransform/'});
        $('.easyui-tabs').tabs();
       
       $('#selectCategoria').combobox({valueField:'id',textField:'text'});
        //$('.easyui-combotree').
        $('.easyui-numberspinner').numberspinner();

        $('.is_required').validatebox({
            required: true,
            //validType: 'url',
            missingMessage: 'Esse campo é obrigatório!'
        });



        $(".formatDATE").mask("99/99/9999");
        $(".formatCPF").mask("999.999.999-99");
        $(".formatCNPJ").mask("99.999.999/9999-99");
        $(".formatCEP").mask("99.999-999");
        $(".formatTEL").mask("(99) 9999-9999");
        $(".formatMONEY").maskMoney({showSymbol: false, symbol: "R$", decimal: ".", thousands: ",", allowZero: true});

    });

$(document).ready(function() {
    $(".dsc").load("projeto/getDisciplinaByBanca/"+<?php echo $projeto->COD_BANCA?>);
    $("#selectBanca").combobox({
        valueField: 'id',
        onSelect:function(rec){
            $(".dsc").load("projeto/getDisciplinaByBanca/"+rec.id);
        }
    });
      
});


</script>
<?php /*
function strToHex($str, $delimiter = '',$inserir=false){ 
    for($i=0; $i<strlen($str); $i++){ 
        $n_str[] = base_convert(ord($str[$i]), 10, 18); 
    } 
    if ($inserir){
        return implode($delimiter, $n_str); 
    }else{
        return implode('', $n_str); 
    }
} 
echo  strToHex('Ivan Rufino','K',false);

function hexToStr($str, $delimiter = false){ 
    $string = ''; $l='';
    if ($delimiter){$delimiter=$str[2];
        $str = explode($delimiter, $str); 
            for($i=0;$i<count($str);$i++){ 
            $string .= chr(hexdec($str[$i])); 
            } 
    return $string; 
    }
    for($i=0;$i<strlen($str);$i=$i+2){ 
        $l=$str[$i].$str[$i+1];       
        //$string .= chr(hexdec([$i])); 
        $string .= chr(hexdec($l)); 
    } 
    return $string; 
}echo "<br>";
echo hexToStr('49K76K61K6eK20K52K75K66K69K6eK6f',true);
 * */
 
?>
    
<div class="easyui-tabs" fit="true" border="false" id="tt">
    <ul>
        <li><a href="#tabs-1">Projeto</a></li>
        <!--        <li><a href="#tabs-2">Categoria</a></li>-->
    </ul>
    <form id="addProjeto" name="form_add" method="post" action="">
        <div id="tabs-1" style="height:500px; overflow:hidden;"> 

            <fieldset>
                <div class="line">

                <input name="CODIGO" type="hidden" class="textfield-text is_required" required="required" readonly=""  value="<?=$projeto->CODIGO?>"  />
                    <label>Projeto
                        <br />
                        <input name="NOME" type="text" class="textfield-text is_required" required="required" value="<?=$projeto->NOME?>" style="width:175px;" />
                    </label>

                    <label>Categoria
                        <br />
                        <select id="selectCategoria" name="CATEGORIA" class="easyui-combobox" panelHeight="auto" style="width:190px;">
                            <option value="">Escolha uma categoria</option>
                            <?php 
                            
                            foreach ($categorias as $cat) { 
                                $selected="";
                                if ($cat->CODIGO ==$projeto->COD_CATEGORIA){
                                     $selected="selected"; 
                                }
                                ?>
                                
                                <option value="<?= $cat->CODIGO ?>" <?=$selected?>><?= $cat->DESCRICAO ?></option>
                            <?php } ?>


                        </select>
                        </label>
                        <label>Banca
                        <br />
                        <select id="selectBanca" name="BANCA" class="easyui-combobox"  panelHeight="auto" style="width:190px;">
                            <option value="">Escolha uma Banca</option>
                            <?php 
                            
                            foreach ($bancas as $banca) { 
                                $selected="";
                                if ($banca->CODIGO ==$projeto->COD_BANCA){
                                     $selected="selected"; 
                                }
                                ?>
                                
                                <option value="<?= $banca->CODIGO ?>" <?=$selected?>><?= $banca->DESCRICAO ?></option>
                            <?php } ?>


                        </select>
                    </label>


                    <br class="clear">    
                    <label>Descrição do Projeto
                        <br />
                        <textarea name="DESCRICAO" class="is_required" style="width: 645px;height: 60px;"><?=$projeto->DESCRICAO?></textarea>

                    </label>
                  <br class="clear"><br class="clear">  
                  <div  class="alert alert-success dsc" style="max-height: 315px;overflow: auto;">
                        <strong>Selecione uma banca</strong>
                    </div>
                </div>
            </fieldset>
            

        </div><!-- /Inicio-->


    

</div><!-- /Inicio-->
</form>
</div><!-- /.easyui-tabs -->